import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../pages/login.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login' //重定向
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('../pages/home.vue'),
    children: [
      {
        path: '/datas',
        name: 'Datas',
        component: () => import('../pages/1-data-statistics/datas.vue')
      },
      {
        path: '/provincesales',
        name: 'ProvinceSales',
        component: () => import('../pages/1-data-statistics/provinceSales.vue')
      },
      {
        path: '/citysales',
        name: 'CitySales',
        component: () => import('../pages/1-data-statistics/citySales.vue')
      },
      {
        path: '/areasales',
        name: 'AreaSales',
        component: () => import('../pages/1-data-statistics/areaSales.vue')
      },
      {
        path: '/provinceactive',
        name: 'ProvinceActive',
        component: () => import('../pages/1-data-statistics/provinceActive.vue')
      },
      {
        path: '/cityactive',
        name: 'CityActive',
        component: () => import('../pages/1-data-statistics/cityActive.vue')
      },
      {
        path: '/areaactive',
        name: 'AreaActive',
        component: () => import('../pages/1-data-statistics/areaActive.vue')
      },


      //第二个主菜单页面
      {
        path: '/cart',
        name: 'Cart',
        component: () => import('../pages/2-card/cart.vue')
      },


      //第三个主菜单页面
      {
        path: '/bigcustomerlist',
        name: 'BigCustomerList',
        component: () => import('../pages/3-customer/bigCustomerList.vue')
      },
      {
        path: '/orderlist',
        name: 'OrderList',
        component: () => import('../pages/3-customer/orderList.vue')
      },
      {
        path: '/setup',
        name: 'Setup',
        component: () => import('../pages/3-customer/setup.vue')
      },



      //第四个主菜单页面
      {
        path: '/financiallist',
        name: 'FinancialList',
        component: () => import('../pages/4-finance/financialList.vue')
      },
      {
        path: '/manifestlist',
        name: 'ManifestList',
        component: () => import('../pages/4-finance/manifestList.vue')
      },
      {
        path: '/walletlist',
        name: 'WalletList',
        component: () => import('../pages/4-finance/walletList.vue')
      },
      {
        path: '/revieworderlist',
        name: 'RevieworderList',
        component: () => import('../pages/4-finance/revieworderList.vue')
      },


      //第五个主菜单页面
      {
        path: '/authority',
        name: 'Authority',
        component: () => import('../pages/5-system/authority.vue')
      },
      {
        path: '/rersonnel',
        name: 'Rersonnel',
        component: () => import('../pages/5-system/rersonnel.vue')
      },
      {
        path: '/role',
        name: 'Role',
        component: () => import('../pages/5-system/role.vue')
      },
      {
        path: '/menu',
        name: 'Menu',
        component: () => import('../pages/5-system/menu.vue')
      },
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})



export default router
